package com.ruoyi.archive.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.archive.mapper.SLivingConditionInfoMapper;
import com.ruoyi.archive.domain.SLivingConditionInfo;
import com.ruoyi.archive.service.ISLivingConditionInfoService;

/**
 * 生活状况模块Service业务层处理
 *
 * @author Allen
 * @date 2021-10-08
 */
@Service
public class SLivingConditionInfoServiceImpl extends ServiceImpl<SLivingConditionInfoMapper, SLivingConditionInfo> implements ISLivingConditionInfoService {
    @Autowired
    private SLivingConditionInfoMapper sLivingConditionInfoMapper;

    /**
     * 查询生活状况模块
     *
     * @param id
     *         生活状况模块主键
     *
     * @return 生活状况模块
     */
    @Override
    public SLivingConditionInfo selectSLivingConditionInfoById(Long id) {
        return sLivingConditionInfoMapper.selectSLivingConditionInfoById(id);
    }

    /**
     * 查询生活状况模块列表
     *
     * @param sLivingConditionInfo
     *         生活状况模块
     *
     * @return 生活状况模块
     */
    @Override
    public List<SLivingConditionInfo> selectSLivingConditionInfoList(SLivingConditionInfo sLivingConditionInfo) {
        return sLivingConditionInfoMapper.selectSLivingConditionInfoList(sLivingConditionInfo);
    }

    /**
     * 新增生活状况模块
     *
     * @param sLivingConditionInfo
     *         生活状况模块
     *
     * @return 结果
     */
    @Override
    public int insertSLivingConditionInfo(SLivingConditionInfo sLivingConditionInfo) {
        if (sLivingConditionInfo != null) {
            return sLivingConditionInfoMapper.insertSLivingConditionInfo(sLivingConditionInfo);
        }
        return 0;
    }

    /**
     * 修改生活状况模块
     *
     * @param sLivingConditionInfo
     *         生活状况模块
     *
     * @return 结果
     */
    @Override
    public int updateSLivingConditionInfo(SLivingConditionInfo sLivingConditionInfo) {
        return sLivingConditionInfoMapper.updateSLivingConditionInfo(sLivingConditionInfo);
    }

    /**
     * 批量删除生活状况模块
     *
     * @param ids
     *         需要删除的生活状况模块主键
     *
     * @return 结果
     */
    @Override
    public int deleteSLivingConditionInfoByIds(Long[] ids) {
        return sLivingConditionInfoMapper.deleteSLivingConditionInfoByIds(ids);
    }

    /**
     * 删除生活状况模块信息
     *
     * @param id
     *         生活状况模块主键
     *
     * @return 结果
     */
    @Override
    public int deleteSLivingConditionInfoById(Long id) {
        return sLivingConditionInfoMapper.deleteSLivingConditionInfoById(id);
    }
}
